package com.hrt.web.addressBook.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.hrt.bean.AddressBook;
import com.hrt.web.addressBook.dao.AddressBookDao;
import com.hrt.web.addressBook.service.AddressBookService;
@Transactional
@Service
public class AddressBookServiceImpl implements AddressBookService{
	@Autowired 
	private AddressBookDao addressBookDao;
	@Override
	/**
	 * 保存
	 */
	public void saveAddressBook(AddressBook addressBook) {
		addressBookDao.saveEntity(addressBook);
		
	}

	@Override
	/**
	 * 更新
	 */
	public void updateAddressBook(AddressBook addressBook) {
		addressBookDao.updateEntity(addressBook);
		
	}

	@Override
	/**
	 * 删除
	 */
	public void deleteAddressBook(Long id) {
		addressBookDao.deleteEntity(id);
		
	}

	/**
	 * 根据addressId查找实体
	 */
	@Override
	public AddressBook getAddById(Long addressId) {
		return addressBookDao.getById(addressId);
	}
	/**
	 * 根据memberId查找addressBook集合
	 */
	@Override
	public List<AddressBook> getAddListById(Long memberId) {
		return addressBookDao.getAddListById(memberId);
	}

}
